#ifndef MSGPACKAGE_H
#define MSGPACKAGE_H

// 发送数据封装类
class CMsgPackage
{
public:
    CMsgPackage();

    // 查询类报文封装总函数
    static int QueryMsgPackage(char * sendMsgPointer , unsigned char &sendMsgLen , unsigned char dstNodeId ,
                       unsigned char linkType , unsigned char mainMsgType , unsigned char subMsgType);


    // 自组网模块配置类报文封装总函数
    static int CfgAdMsgPackage(char *sendMsgPointer, unsigned char & sendMsgLen, unsigned char dstNodeId,
                                   unsigned char linkType, unsigned char mainMsgType, char *adHocBuffer);

    // 配置、查询类指令
    static int commonParamQuery( char * msgPointer , unsigned char & msgLen , unsigned char subMsgType );

    // 基本消息封装函数
    static int basicMsgPackage(char * srcMsgPointer , unsigned char srcMsgLen , unsigned char mainMsgType ,
                        char * dstMsgPointer , unsigned char & dstMsgLength , unsigned char dstNodeId ,
                        unsigned char linkType );
    // 计算校验和
    static unsigned char checkSum( char * msgPointer , unsigned char msgLength );

};

#endif // MSGPACKAGE_H
